Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/40437 emoji reactions to work package comments #16020

Draft
wants to merge 40 commits into
base: dev
Choose a base branch
from

Conversation

jjabari-op
Copy link
Collaborator

@jjabari-op jjabari-op commented Jul 2, 2024

Ticket

https://community.openproject.org/projects/openproject/work_packages/40437

What are you trying to accomplish?

Support emoji reactions to work package comments aka "journals"

Screenshots

tbd

What approach did you choose and why?

tbd

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@jjabari-op jjabari-op self-assigned this Jul 2, 2024
@jjabari-op jjabari-op marked this pull request as draft July 2, 2024 19:42
…e/40437-emoji-reactions-to-work-package-comments
@akabiru akabiru self-assigned this Sep 30, 2024
jjabari-op and others added 12 commits October 1, 2024 20:56
…e/40437-emoji-reactions-to-work-package-comments
…e/40437-emoji-reactions-to-work-package-comments
…e/40437-emoji-reactions-to-work-package-comments
…e/40437-emoji-reactions-to-work-package-comments
Users who do not have commenting permissions: typically the `add_work_package_notes` and anonymous
users cannot add new reactions but they can view any existing reactions. Futher, the "Add reactions" button
is also hidden from them.

In view only state, the emoji reactions render as primer invisible buttons in disabled state.

> They can respond to user input and provide feedback, but it does not trigger any actions.
> See: https://primer.style/components/button#inactive

The view only reactions mimic primer inactive buttons but without the muted styling and cursor change
Base automatically changed from feature/54733-primerise-the-activity-panel to dev October 17, 2024 12:06
UTF-8 is widely adopted and the default format for Postgres; storing emoji's in unicode format is then possible
and should be searchable as any other string- and leveragable via AR named enums.

Whilst we could also store integer numbered enums, it would introduce additional overhead that seems unnecessary
Avoid possible collation issues in uncode formats- storing reactions allows us to read the emojis from relevant stores at runtime
 * ARIA-label, show names and emoji type: "{Name of reaction} by {user A}, {user B} and {user C}".
 * Visually, show just names: "{user A}, {user B} and {user C}"
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16020 October 22, 2024 14:54 Inactive
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16020 October 24, 2024 12:05 Inactive
def grouped_emoji_reactions(reactable_id:, reactable_type:, last_updated_at: nil)
query = EmojiReaction
.select("emoji_reactions.reactable_id, emoji_reactions.reaction, COUNT(emoji_reactions.id) as count, " \
"json_agg(json_build_array(users.id, #{user_name_concat_format_sql}) ORDER BY emoji_reactions.created_at) as user_details") # rubocop:disable Layout/LineLength

Check warning

Code scanning / Brakeman

Possible SQL injection. Warning

Possible SQL injection.
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16020 October 24, 2024 17:17 Inactive
@github-actions github-actions bot temporarily deployed to gh-6899875-pr-16020 October 24, 2024 18:30 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants